package com.weiweiqin.service.impl;

import java.util.List;
import java.util.Map;

import com.weiweiqin.dao.CategoryDao;
import com.weiweiqin.model.Category;
import com.weiweiqin.service.CategoryService;
import com.weiweiqin.vo.common.Page;

public class CategoryServiceImpl implements CategoryService {

	private CategoryDao categoryDao;

	public CategoryDao getCategoryDao() {
		return categoryDao;
	}

	public void setCategoryDao(CategoryDao categoryDao) {
		this.categoryDao = categoryDao;
	}

	public void update(Category category) {
		categoryDao.update(category);

	}

	public Category getByName(String name) {
		return categoryDao.getByName(name);
	}

	public List<Category> getAll() {
		return categoryDao.getAll();
	}

	public void save(Category category) {
		categoryDao.insert(category);
	}

	public List<Category> pageList(Page page,Map<String,Object> conditions) {
		return categoryDao.pageList(page,conditions);
	}

	public int totalCount() {
		return categoryDao.totalCount();
	}

	public void del(int id) {
		categoryDao.delete(id);
	}

}